//
//  MyPageSearchTableViewCell.m
//  TTMusic
//
//  Created by yanghuiyan on 16/3/31.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "MyPageSearchTableViewCell.h"

@implementation MyPageSearchTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.backImageView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.backImageView];
        
        self.mySearchImage = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.mySearchImage.image = [UIImage imageNamed:@"search"];
        [self.backImageView addSubview:self.mySearchImage];
        
        self.singImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.singImageView.image = [UIImage imageNamed:@"maike"];
        [self.backImageView addSubview:self.singImageView];
        
        self.label = [[UILabel alloc] initWithFrame:CGRectZero];
        self.label.text = @"搜索";
        self.label.textColor = [UIColor grayColor];
        [self.backImageView addSubview:self.label];
        
    }
    return self;
}


- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    self.backImageView.frame = CGRectMake(10, 10, Width - 20, Height - 20);
    
    self.backImageView.layer.cornerRadius = 5;
    self.backImageView.layer.masksToBounds = YES;
    
    self.mySearchImage.frame = CGRectMake(self.backImageView.frame.size.width / 2 - 40, 0, 30, 30);
    
    self.singImageView.frame = CGRectMake(self.backImageView.frame.size.width - 60, 0, 30, 30);
    
    self.label.frame = CGRectMake(self.backImageView.frame.size.width / 2 - 35 + 35, 0, 60, 30);

}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
